package cn.dengl.sky.springboot.common.config.util;

public enum CommonEnum implements CommonInterface{
    CASE("case",1),
    LOSS("loss",2);
    private String name;
    private int index;
    private CommonEnum(String name,int index){
        this.index=index;
        this.name=name;

    }
    // 普通方法
    public static String getName(int index) {
        for (CommonEnum c : CommonEnum.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return super.toString();
    }
    @Override
    public String getVal() {
        return this.name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
